home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form Form1
- Caption = "Form1"
- ClientHeight = 3525
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 5175
- LinkTopic = "Form1"
- ScaleHeight = 3525
- ScaleWidth = 5175
- StartUpPosition = 3 'Windows Default
- Begin VB.TextBox Text2
- Height = 495
- Left = 1680
- TabIndex = 5
- Text = "Find the word the in here"
- Top = 360
- Width = 2355
- End
- Begin VB.CommandButton Command2
- Caption = "Close"
- Height = 495
- Left = 3360
- TabIndex = 4
- Top = 2760
- Width = 1215
- End
- Begin VB.CommandButton Command1
- Caption = "Find"
- Height = 495
- Left = 1800
- TabIndex = 1
- Top = 1800
- Width = 1455
- End
- Begin VB.TextBox Text1
- Height = 495
- Left = 1920
- TabIndex = 0
- Text = "the"
- Top = 1080
- Width = 1215
- End
- Begin VB.Label Label2
- Caption = "Main Str"
- Height = 375
- Left = 600
- TabIndex = 3
- Top = 360
- Width = 615
- End
- Begin VB.Label Label1
- Caption = "Find str"
- Height = 375
- Left = 720
- TabIndex = 2
- Top = 1080
- Width = 615
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Dim sublen As Integer, Pos As Integer
- Private Sub Command1_Click()
- If Len(Text1.Text) = 0 Then
- MsgBox "Enter String to be found"
- If Len(Text2.Text) = 0 Then
- MsgBox "Enter String to be searched in"
- sublen = Len(Text1.Text)
- Pos = InStr(Text2.Text, Text1.Text)
- If (Pos > 0) Then
- Text2.SetFocus
- Text2.SelStart = Pos - 1
- Text2.SelLength = Len(Text1.Text)
- MsgBox "String not found"
- End If
- End If
- End If
- End Sub
- Private Sub Command2_Click()
- Unload Me
- End Sub
-